package poo.exo1a;
import poo.Exceptions.*;

public class CompteEpargne extends CompteAvecLimite {

        private static final double tauxInteret = 4.5;
        private final double minimumVersement   = 1000;
        private final double minimumCredit;

        public CompteEpargne(String nom, int numero, double solde,
                        double minimumCredit) throws SoldeMinimumRequis
        {
                super(nom, numero, solde);

                // Le solde a la creation doit etre au minimum egal au minimum de versement
                if(solde < this.minimumVersement){
                        throw new SoldeMinimumRequis("Le solde initial doit �tre au minimum de "+this.minimumVersement+" euros\n", solde);
                }
                this.minimumCredit = minimumCredit;
        }
        public static double getTauxInteret(){
                return tauxInteret;
        }
        public double getMinimumCredit(){
                return this.minimumCredit;
        }
        @Override
        public String toString(){
                return super.toString();
        }
}
